﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<UncleBobWebService.Models.MultipleChoiceQuestion>" %>

<!DOCTYPE html>

<html>
  <head id="MultipleChoiceQuestion" runat="server">
    <title>Application</title>
    <link href="/Theme/UncleBobTheme.css" rel="Stylesheet" />
  </head>

<body>
    <h2>Question</h2>
    <div class="body">

    <!-- Begin Form -->
    <% using (Html.BeginForm("FormAction", "ApplicantApply", FormMethod.Post)) {%>
        <div class="box">
            <div class="left-justify">

                <!-- Display the question -->
                <div><%= Html.DisplayFor(model => Model.Question)%></div>
                <br />

                <!-- Generate the number of radio buttons based on number of possible answers -->
                <% for (int i = 0; i < Model.PossibleAnswers.Count; ++i) { %>
                <label>
                    <%= Html.RadioButton("answer", i)%>
                    <%= Model.PossibleAnswers[i].TheAnswer%>
                    <br />
                </label>
                <% } %>

            </div>
        </div>

        <!-- Only display "Previous" Button if the Count is greater than 0 -->
        <%if (Model.RuntimeCount == 0) {%>
            <input class="button" type="submit" name="next" value="Next" />
        <%}%>
        <%else {%>
            <input class="button" type="submit" name="previous" value="Previous" />
            <input class="button" type="submit" name="next" value="Next" />
        <%}%>
    <%}%>

    </div>
</body>

</html>